Optimal. Leaf size=499 \[ -\frac {\tan ^{-1}\left (\frac {\sqrt {b} \tan (c+d x)}{\sqrt {a+2 a \tan ^2(c+d x)+(a+b) \tan ^4(c+d x)}}\right ) \cos ^2(c+d x) \sqrt {a+2 a \tan ^2(c+d x)+(a+b) \tan ^4(c+d x)}}{2 \sqrt {b} d \sqrt {a+b \sin ^4(c+d x)}}-\frac {\sqrt [4]{a} \left (\sqrt {a}+\sqrt {a+b}\right ) \cos ^2(c+d x) F\left (2 \tan ^{-1}\left (\frac {\sqrt [4]{a+b} \tan (c+d x)}{\sqrt [4]{a}}\right )|\frac {1}{2} \left (1-\frac {\sqrt {a}}{\sqrt {a+b}}\right )\right ) \left (\sqrt {a}+\sqrt {a+b} \tan ^2(c+d x)\right ) \sqrt {\frac {a+2 a \tan ^2(c+d x)+(a+b) \tan ^4(c+d x)}{\left (\sqrt {a}+\sqrt {a+b} \tan ^2(c+d x)\right )^2}}}{2 b \sqrt [4]{a+b} d \sqrt {a+b \sin ^4(c+d x)}}+\frac {\left (\sqrt {a}+\sqrt {a+b}\right )^2 \cos ^2(c+d x) \Pi \left (-\frac {\left (\sqrt {a}-\sqrt {a+b}\right )^2}{4 \sqrt {a} \sqrt {a+b}};2 \tan ^{-1}\left (\frac {\sqrt [4]{a+b} \tan (c+d x)}{\sqrt [4]{a}}\right )|\frac {1}{2} \left (1-\frac {\sqrt {a}}{\sqrt {a+b}}\right )\right ) \left (\sqrt {a}+\sqrt {a+b} \tan ^2(c+d x)\right ) \sqrt {\frac {a+2 a \tan ^2(c+d x)+(a+b) \tan ^4(c+d x)}{\left (\sqrt {a}+\sqrt {a+b} \tan ^2(c+d x)\right )^2}}}{4 \sqrt [4]{a} b \sqrt [4]{a+b} d \sqrt {a+b \sin ^4(c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.46, antiderivative size = 499, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {3298, 1333,
1117, 1720} \begin {gather*} -\frac {\cos ^2(c+d x) \sqrt {(a+b) \tan ^4(c+d x)+2 a \tan ^2(c+d x)+a} \text {ArcTan}\left (\frac {\sqrt {b} \tan (c+d x)}{\sqrt {(a+b) \tan ^4(c+d x)+2 a \tan ^2(c+d x)+a}}\right )}{2 \sqrt {b} d \sqrt {a+b \sin ^4(c+d x)}}-\frac {\sqrt [4]{a} \left (\sqrt {a+b}+\sqrt {a}\right ) \cos ^2(c+d x) \left (\sqrt {a+b} \tan ^2(c+d x)+\sqrt {a}\right ) \sqrt {\frac {(a+b) \tan ^4(c+d x)+2 a \tan ^2(c+d x)+a}{\left (\sqrt {a+b} \tan ^2(c+d x)+\sqrt {a}\right )^2}} F\left (2 \text {ArcTan}\left (\frac {\sqrt [4]{a+b} \tan (c+d x)}{\sqrt [4]{a}}\right )|\frac {1}{2} \left (1-\frac {\sqrt {a}}{\sqrt {a+b}}\right )\right )}{2 b d \sqrt [4]{a+b} \sqrt {a+b \sin ^4(c+d x)}}+\frac {\left (\sqrt {a+b}+\sqrt {a}\right )^2 \cos ^2(c+d x) \left (\sqrt {a+b} \tan ^2(c+d x)+\sqrt {a}\right ) \sqrt {\frac {(a+b) \tan ^4(c+d x)+2 a \tan ^2(c+d x)+a}{\left (\sqrt {a+b} \tan ^2(c+d x)+\sqrt {a}\right )^2}} \Pi \left (-\frac {\left (\sqrt {a}-\sqrt {a+b}\right )^2}{4 \sqrt {a} \sqrt {a+b}};2 \text {ArcTan}\left (\frac {\sqrt [4]{a+b} \tan (c+d x)}{\sqrt [4]{a}}\right )|\frac {1}{2} \left (1-\frac {\sqrt {a}}{\sqrt {a+b}}\right )\right )}{4 \sqrt [4]{a} b d \sqrt [4]{a+b} \sqrt {a+b \sin ^4(c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 1117
Rule 1333
Rule 1720
Rule 3298
Rubi steps
\begin {align*} \int \frac {\sin ^2(c+d x)}{\sqrt {a+b \sin ^4(c+d x)}} \, dx &=\frac {\left (\cos ^2(c+d x) \sqrt {a+2 a \tan ^2(c+d x)+(a+b) \tan ^4(c+d x)}\right ) \text {Subst}\left (\int \frac {x^2}{\left (1+x^2\right ) \sqrt {a+2 a x^2+(a+b) x^4}} \, dx,x,\tan (c+d x)\right )}{d \sqrt {a+b \sin ^4(c+d x)}}\\ &=-\frac {\left (a \left (1+\frac {\sqrt {a+b}}{\sqrt {a}}\right ) \cos ^2(c+d x) \sqrt {a+2 a \tan ^2(c+d x)+(a+b) \tan ^4(c+d x)}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a+2 a x^2+(a+b) x^4}} \, dx,x,\tan (c+d x)\right )}{b d \sqrt {a+b \sin ^4(c+d x)}}+\frac {\left (a \left (1+\frac {\sqrt {a+b}}{\sqrt {a}}\right ) \cos ^2(c+d x) \sqrt {a+2 a \tan ^2(c+d x)+(a+b) \tan ^4(c+d x)}\right ) \text {Subst}\left (\int \frac {1+\frac {\sqrt {a+b} x^2}{\sqrt {a}}}{\left (1+x^2\right ) \sqrt {a+2 a x^2+(a+b) x^4}} \, dx,x,\tan (c+d x)\right )}{b d \sqrt {a+b \sin ^4(c+d x)}}\\ &=-\frac {\tan ^{-1}\left (\frac {\sqrt {b} \tan (c+d x)}{\sqrt {a+2 a \tan ^2(c+d x)+(a+b) \tan ^4(c+d x)}}\right ) \cos ^2(c+d x) \sqrt {a+2 a \tan ^2(c+d x)+(a+b) \tan ^4(c+d x)}}{2 \sqrt {b} d \sqrt {a+b \sin ^4(c+d x)}}-\frac {\sqrt [4]{a} \left (\sqrt {a}+\sqrt {a+b}\right ) \cos ^2(c+d x) F\left (2 \tan ^{-1}\left (\frac {\sqrt [4]{a+b} \tan (c+d x)}{\sqrt [4]{a}}\right )|\frac {1}{2} \left (1-\frac {\sqrt {a}}{\sqrt {a+b}}\right )\right ) \left (\sqrt {a}+\sqrt {a+b} \tan ^2(c+d x)\right ) \sqrt {\frac {a+2 a \tan ^2(c+d x)+(a+b) \tan ^4(c+d x)}{\left (\sqrt {a}+\sqrt {a+b} \tan ^2(c+d x)\right )^2}}}{2 b \sqrt [4]{a+b} d \sqrt {a+b \sin ^4(c+d x)}}+\frac {\left (\sqrt {a}+\sqrt {a+b}\right )^2 \cos ^2(c+d x) \Pi \left (-\frac {\left (\sqrt {a}-\sqrt {a+b}\right )^2}{4 \sqrt {a} \sqrt {a+b}};2 \tan ^{-1}\left (\frac {\sqrt [4]{a+b} \tan (c+d x)}{\sqrt [4]{a}}\right )|\frac {1}{2} \left (1-\frac {\sqrt {a}}{\sqrt {a+b}}\right )\right ) \left (\sqrt {a}+\sqrt {a+b} \tan ^2(c+d x)\right ) \sqrt {\frac {a+2 a \tan ^2(c+d x)+(a+b) \tan ^4(c+d x)}{\left (\sqrt {a}+\sqrt {a+b} \tan ^2(c+d x)\right )^2}}}{4 \sqrt [4]{a} b \sqrt [4]{a+b} d \sqrt {a+b \sin ^4(c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 32.08, size = 287, normalized size = 0.58 \begin {gather*} -\frac {2 i \cos ^2(c+d x) \left (F\left (i \sinh ^{-1}\left (\sqrt {1-\frac {i \sqrt {b}}{\sqrt {a}}} \tan (c+d x)\right )|\frac {\sqrt {a}+i \sqrt {b}}{\sqrt {a}-i \sqrt {b}}\right )-\Pi \left (\frac {\sqrt {a}}{\sqrt {a}-i \sqrt {b}};i \sinh ^{-1}\left (\sqrt {1-\frac {i \sqrt {b}}{\sqrt {a}}} \tan (c+d x)\right )|\frac {\sqrt {a}+i \sqrt {b}}{\sqrt {a}-i \sqrt {b}}\right )\right ) \sqrt {1+\left (1+\frac {i \sqrt {b}}{\sqrt {a}}\right ) \tan ^2(c+d x)} \sqrt {2+\left (2-\frac {2 i \sqrt {b}}{\sqrt {a}}\right ) \tan ^2(c+d x)}}{\sqrt {1-\frac {i \sqrt {b}}{\sqrt {a}}} d \sqrt {8 a+3 b-4 b \cos (2 (c+d x))+b \cos (4 (c+d x))}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 46.24, size = 881, normalized size = 1.77
method | result | size |
default | \(-\frac {\sqrt {\left (4 a +\left (\cos ^{2}\left (2 d x +2 c \right )\right ) b +b -2 b \cos \left (2 d x +2 c \right )\right ) \left (\sin ^{2}\left (2 d x +2 c \right )\right )}\, \sqrt {-a b}\, \sqrt {\frac {\left (-b +\sqrt {-a b}\right ) \left (-1+\cos \left (2 d x +2 c \right )\right )}{\sqrt {-a b}\, \left (\cos \left (2 d x +2 c \right )+1\right )}}\, \left (\cos \left (2 d x +2 c \right )+1\right )^{2} \sqrt {\frac {-b \cos \left (2 d x +2 c \right )+2 \sqrt {-a b}+b}{\sqrt {-a b}\, \left (\cos \left (2 d x +2 c \right )+1\right )}}\, \sqrt {\frac {b \cos \left (2 d x +2 c \right )+2 \sqrt {-a b}-b}{\sqrt {-a b}\, \left (\cos \left (2 d x +2 c \right )+1\right )}}\, \left (\EllipticF \left (\sqrt {\frac {\left (-b +\sqrt {-a b}\right ) \left (-1+\cos \left (2 d x +2 c \right )\right )}{\sqrt {-a b}\, \left (\cos \left (2 d x +2 c \right )+1\right )}}, \sqrt {\frac {b +\sqrt {-a b}}{-b +\sqrt {-a b}}}\right )-2 \EllipticPi \left (\sqrt {\frac {\left (-b +\sqrt {-a b}\right ) \left (-1+\cos \left (2 d x +2 c \right )\right )}{\sqrt {-a b}\, \left (\cos \left (2 d x +2 c \right )+1\right )}}, \frac {\sqrt {-a b}}{-b +\sqrt {-a b}}, \sqrt {\frac {b +\sqrt {-a b}}{-b +\sqrt {-a b}}}\right )\right )}{2 \left (-b +\sqrt {-a b}\right ) \sqrt {\frac {\left (-1+\cos \left (2 d x +2 c \right )\right ) \left (\cos \left (2 d x +2 c \right )+1\right ) \left (-b \cos \left (2 d x +2 c \right )+2 \sqrt {-a b}+b \right ) \left (b \cos \left (2 d x +2 c \right )+2 \sqrt {-a b}-b \right )}{b}}\, \sin \left (2 d x +2 c \right ) \sqrt {4 a +\left (\cos ^{2}\left (2 d x +2 c \right )\right ) b +b -2 b \cos \left (2 d x +2 c \right )}\, d}-\frac {\sqrt {\left (4 a +\left (\cos ^{2}\left (2 d x +2 c \right )\right ) b +b -2 b \cos \left (2 d x +2 c \right )\right ) \left (\sin ^{2}\left (2 d x +2 c \right )\right )}\, \sqrt {-a b}\, \sqrt {\frac {\left (-b +\sqrt {-a b}\right ) \left (-1+\cos \left (2 d x +2 c \right )\right )}{\sqrt {-a b}\, \left (\cos \left (2 d x +2 c \right )+1\right )}}\, \left (\cos \left (2 d x +2 c \right )+1\right )^{2} \sqrt {\frac {-b \cos \left (2 d x +2 c \right )+2 \sqrt {-a b}+b}{\sqrt {-a b}\, \left (\cos \left (2 d x +2 c \right )+1\right )}}\, \sqrt {\frac {b \cos \left (2 d x +2 c \right )+2 \sqrt {-a b}-b}{\sqrt {-a b}\, \left (\cos \left (2 d x +2 c \right )+1\right )}}\, \EllipticF \left (\sqrt {\frac {\left (-b +\sqrt {-a b}\right ) \left (-1+\cos \left (2 d x +2 c \right )\right )}{\sqrt {-a b}\, \left (\cos \left (2 d x +2 c \right )+1\right )}}, \sqrt {\frac {b +\sqrt {-a b}}{-b +\sqrt {-a b}}}\right )}{2 \left (-b +\sqrt {-a b}\right ) \sqrt {\frac {\left (-1+\cos \left (2 d x +2 c \right )\right ) \left (\cos \left (2 d x +2 c \right )+1\right ) \left (-b \cos \left (2 d x +2 c \right )+2 \sqrt {-a b}+b \right ) \left (b \cos \left (2 d x +2 c \right )+2 \sqrt {-a b}-b \right )}{b}}\, \sin \left (2 d x +2 c \right ) \sqrt {4 a +\left (\cos ^{2}\left (2 d x +2 c \right )\right ) b +b -2 b \cos \left (2 d x +2 c \right )}\, d}\) | \(881\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.20, size = 40, normalized size = 0.08 \begin {gather*} {\rm integral}\left (-\frac {\cos \left (d x + c\right )^{2} - 1}{\sqrt {b \cos \left (d x + c\right )^{4} - 2 \, b \cos \left (d x + c\right )^{2} + a + b}}, x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\sin \left (c+d\,x\right )}^2}{\sqrt {b\,{\sin \left (c+d\,x\right )}^4+a}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________